<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			let money = 10; //卡里钱
			if (money === 100) {
				console.log("二两螺蛳粉");
			} else if (money > 80 && money <= 99) {
				console.log("两份二两螺蛳粉+鸭脚");
			} else if (money >= 60 && money <= 80) {
				console.log("吃两份三两的+卤蛋");
			} else {
				console.log("去一个包间里，吃一份螺蛳粉")
			}
			console.log("小朋友才做选择，成年人都要");

			let month = 1;
			switch (month) {
				case 12:
				case 1:
				case 2:
					console.log("冬季");
					break; //跳出switch语句的
				case 3:
				case 4:
				case 5:
					console.log("春季");
					break;
				case 6:
				case 7:
				case 8:
					console.log("夏季");
					break;
				case 9:
				case 10:
					//在10里面没有break，所以会继续往下执行
				case 11:
					console.log("秋季");
					break;
				default:
					console.log("不知道");
					break;
			}

			/*
			6.从键盘分别输入年、月、日，判断这一天是当年的第几天
			 
			   注：判断一年是否是闰年的标准：
			       1）可以被4整除，但不可被100整除
			       2）可以被400整除
				
				1.10	第10天
				2.10	第31 + 10天
				3.10	第31 + 28/29 + 10
				4.10	第31 + 28/29 + 31 + 10
			*/
			let year = 2020;
			month = 3;
			let day = 27;
			let count = day;
			switch (month) {
				case 12:
				case 11:
				case 10:
				case 9:
				case 8:
				case 7:
				case 6:
				case 5:
				case 4:
					count += 31;
				case 3:
					count += 28;
					if((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) {
						count += 1;
					}
				case 2:
					count += 31;
				case 1:
					console.log(year + "年" + month + "月" + day + "日是第" + count + "天");
			}
		</script>
	</body>
</html>
